fix segmentation fault in GUI map preview. (#592)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sat, 6 Jun 2020 16:44:04 +0000 (10:44 -0600)
committerGitHub <noreply@github.com>
Sat, 6 Jun 2020 16:44:04 +0000 (10:44 -0600)
gui/gmapdlg.cc

index 5aaf83db1f020acb6c987517f887a9381f6e841b..8b761441b5b8f9bcba0258521e9a2303caeab64b 100644 (file)
@@ -497,10 +497,10 @@ void GMapDialog::hideAllRoutes()
 //------------------------------------------------------------------------
 void GMapDialog::showOnlyThisWaypoint()
 {
-  QList <GpxWaypoint>& tlist = gpx_.getWaypoints();
-  for (int i=0; i<tlist.size(); i++) {
-    tlist[i].setVisible(i == menuIndex_);
-    trkList_[i]->setCheckState(i==menuIndex_? Qt::Checked: Qt::Unchecked);
+  QList <GpxWaypoint>& wlist = gpx_.getWaypoints();
+  for (int i=0; i<wlist.size(); i++) {
+    wlist[i].setVisible(i == menuIndex_);
+    wptList_[i]->setCheckState(i==menuIndex_? Qt::Checked: Qt::Unchecked);
   }
   wptItem_->setCheckState(Qt::Checked);
   mapWidget_->showWaypoints(gpx_.getWaypoints());